- Posts: 15
Excluding Field
- Herbert Berkley
- Topic Author
- Offline
- User
Less
More
12 years 5 months ago #2240
by Herbert Berkley
Excluding Field - Post(2240) was created by Herbert Berkley
i am using some code that creates a file name based on a field.. it also includes that field into the file being created. i use the unique field for each file but i don't want to throw it into the created file..
here is my code..
public object dowork()
{
if (invalues.length != 2)
throw new exception("2 inputparameter expected!");
// get the textfile adapter from the write side
textfileadapter adapter = (textfileadapter)adapterwrite;
// build the new filename using the invoicenumber = second input parameter
string filename = (string)invalues[1].getstring();
if (filename == null)
throw new exception("not a valid invoice number!");
filename += ".txt"; // you can changes the ending by yourself
// set new file name on the write side
adapter.filename = filename;
// return the first input parameter for further processing
return invalues[0].getvalue();
}
i have attached an image file that shows the first number in the sequence, invoice number, that needs to be left out when generating each individual file.
here is my code..
public object dowork()
{
if (invalues.length != 2)
throw new exception("2 inputparameter expected!");
// get the textfile adapter from the write side
textfileadapter adapter = (textfileadapter)adapterwrite;
// build the new filename using the invoicenumber = second input parameter
string filename = (string)invalues[1].getstring();
if (filename == null)
throw new exception("not a valid invoice number!");
filename += ".txt"; // you can changes the ending by yourself
// set new file name on the write side
adapter.filename = filename;
// return the first input parameter for further processing
return invalues[0].getvalue();
}
i have attached an image file that shows the first number in the sequence, invoice number, that needs to be left out when generating each individual file.
Attachments:
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
12 years 5 months ago #2241
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Re:Excluding Field - Post(2241)
Hi Herbert,
You do not need a script for this anymore. With the help of Parameters this is quite simple.
You just need one String Append Heater to build the dynamic export file name and one Set Parameter Heater to set the Parameter "$Filename$" to this new value.
On the WRITE side you have to set the export file name to $Filename$ that’s all.
You can find a brief example in the attachment.
You do not need a script for this anymore. With the help of Parameters this is quite simple.
You just need one String Append Heater to build the dynamic export file name and one Set Parameter Heater to set the Parameter "$Filename$" to this new value.
On the WRITE side you have to set the export file name to $Filename$ that’s all.
You can find a brief example in the attachment.
Attachment dynamic_filename_with_parameter.zip not found
Best wishes
Robert Stark
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.256 seconds