none
promoted property append to file name

    Question

  • How can we append promoted property in filename from send port  .
    TSCODE is promoted property

    i tried file Name :@TSCODE%MessageID%.xml
    but not working

    thanks ,
    Rajesh


    rajesh
    Thursday, April 23, 2009 9:25 AM

Answers

  • It has to be set in one of the properties that are used in one of the standard macros. You can find the standard macros in the links Randal suggested.

    Normally, I think, people set the value of the "ReceivedFileName" property to what they want. And in the send port they use the %SourceFileName% macro.

    There is no way you can use properties/macros that are not in the list of stadard macros. So you can not use a value in one of your properties as the filename.


    eliasen, representing himself and not the company he works for.
    MVP and three times MCTS in BizTalk.
    Blog: http://blog.eliasen.dk
    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Thursday, April 23, 2009 12:29 PM
  • Hi,

    You better use receive filename as Jan suggested:

    objIBaseMessageContext.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", "PO")

    After that use something like "C:\BiztalkFiles\GenericXMLOut\%SourceFileName%%MessageID%.xml" in your send port.

    HTH,

    Randal van Splunteren
    http://biztalkmessages.vansplunteren.net

    Please mark answered if this answers your question.


    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Thursday, April 23, 2009 1:26 PM
  • Just a quick note: you could make it a bit more generic by adding a parameter to your pipeline component that would have the name and namespace of the promoted property to read from and write it to the ReceivedFileName.
    Thiago Almeida - http://connectedthoughts.wordpress.com
    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Sunday, April 26, 2009 11:58 PM

All replies

  • if you are using orchestration then set destination party with Promoted value and you can use %DestinationParty%%MessageID%.xml
     macro in send port
    KiranMP
    Thursday, April 23, 2009 10:14 AM
  • Hi,

    You need to use one of the available predefined macros. Use a macro that references the value of a BizTalk property. You need to set the value of the property first. You can do that using an orchestration or in a pipeline component in code. Unfortunatelly you cannot use your own custom macros.

    There are a lot of people that blogged about the available macros. See for example:

    http://jglisson73.blogspot.com/2007/01/biztalk-send-port-file-name-macros.html

    and

    http://weblogs.asp.net/jan/archive/2004/03/19/92701.aspx

     

    HTH,

    Randal van Splunteren
    http://biztalkmessages.vansplunteren.net

    Please mark answered if this answers your question.

     


    Thursday, April 23, 2009 11:03 AM
  • Hi Randal thanks for reply

    can you explain how it should done using  in a pipeline component


    thanks
    Rajesh
    rajesh
    Thursday, April 23, 2009 11:52 AM
  • i tried  with set the value of the property first in componenet but in it is not accessing dynamic value in
    send port file name text  box it refers static value

    thanks
    rajesh
    rajesh
    Thursday, April 23, 2009 11:55 AM
  • It has to be set in one of the properties that are used in one of the standard macros. You can find the standard macros in the links Randal suggested.

    Normally, I think, people set the value of the "ReceivedFileName" property to what they want. And in the send port they use the %SourceFileName% macro.

    There is no way you can use properties/macros that are not in the list of stadard macros. So you can not use a value in one of your properties as the filename.


    eliasen, representing himself and not the company he works for.
    MVP and three times MCTS in BizTalk.
    Blog: http://blog.eliasen.dk
    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Thursday, April 23, 2009 12:29 PM
  • hi eliasen

    how we can set in receive edi  pipiline componenet  set the value of the "ReceivedFileName" property to what they want

    t tried following but not worked

    objIBaseMessageContext.Write(

    "ISA07", @"http://schemas.microsoft.com/Edi/PropertySchema", "PO");

    in send port i set %DestinationPartyQualifier%%MessageID%.xml
    it gives me error

    A message sent to adapter "FILE" on send port "GenericXMLOut" with URI "C:\BiztalkFiles\GenericXMLOut\%DestinationPartyQualifier%%MessageID%.xml" is suspended.

    Error details: This transport requires either source and destination names or qualifiers.

    Please specify names or qualifiers in the transaction's messaging port.

    MessageId: {9A7227D4-FAE7-4C46-8100-92495D956878}

    InstanceID: {4F7C1467-2705-4EC8-A83D-C17B51E4F7B3}

    thx
    Rajesh


    rajesh
    Thursday, April 23, 2009 1:10 PM
  • Hi,

    You better use receive filename as Jan suggested:

    objIBaseMessageContext.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", "PO")

    After that use something like "C:\BiztalkFiles\GenericXMLOut\%SourceFileName%%MessageID%.xml" in your send port.

    HTH,

    Randal van Splunteren
    http://biztalkmessages.vansplunteren.net

    Please mark answered if this answers your question.


    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Thursday, April 23, 2009 1:26 PM
  • Just a quick note: you could make it a bit more generic by adding a parameter to your pipeline component that would have the name and namespace of the promoted property to read from and write it to the ReceivedFileName.
    Thiago Almeida - http://connectedthoughts.wordpress.com
    • Marked as answer by edhickey Tuesday, May 19, 2009 6:11 PM
    Sunday, April 26, 2009 11:58 PM