I am running this code as a script task in a business process.

string POid = Get<string>("PurchaseOrderID");
var arParts = POid.Split('_');
 
 
		int i = Convert.ToInt32(arParts[1]);
		int newid = i + 1;
		string prefix = string.Empty;
		if(newid<10){
			prefix="00000";
		}
		else if (newid<100)
		{ prefix="0000";
		}
		else if (newid<1000)
		{
			prefix="000";
		}
		else if (newid<10000)
		{
			prefix="00";
		}
		else if (newid<100000)
		{
			prefix="0";
		}
 
		string intstringid = newid.ToString();
		string name = prefix + intstringid; 
		string newPOid = "PO_" + name;
		Set("NewPurchaseOrderID", newPOid);
return true;

I have "PurchaseOrderID" and "NewPurchaseOrderID" as the parameters that I've defined for this business process. They are spelled as in the code, I've checked that.

 

When I try to run this process, I get the error: Object reference not set to an instance of an object.

 

Can't seem to find which object I have not initiated.

 

Any help would be appreciated.

 

Thanks.

-AK

Like 0

Like

1 comments

It seems that  "PurchaseOrderID"  parameter has no value, so in the following row

var arParts = POid.Split('_')

the error "Object reference not set to an instance of an object" occurs because POid is null. To know for sure please debug the code. The article by the link below will be helpful in that: https://academy.bpmonline.com/documents/technic-sdk/7-13/server-code-debugging

Show all comments

Is there an object that can be used to trigger start a process when a new attachment is added on the attachments tab of a record?

For certain sections, it would be nice to receive an email notification when a new attachment is added.

Like 0

Like

1 comments

Dear Mitch,

You can use "SectionName attachment" objects to trigger such process, for example "Contact attachment" object. 

Best regards,

Angela

Show all comments

Hi everyone,

I'm facing a problem in the business process , when I try to save the business process element , the following message appears: ' Error occurred when saving : Collection item  with unique identifier not found '

Like 0

Like

0 comments
Show all comments

How can I send an email from a business process to a group of recipients who are in the same Organizational Unit?

For example, highlighted in the picture below I tried to make a process that sent an email to the contacts in the organizational role "Strategic Partner Support", however when the process ran, no email was sent. So instead I had to add individual contacts, but I am trying to avoid needing to update individual contacts in this process element as our employees come and go or change roles.

I also tried using a system setting, and added a organizational role to that system setting, but that did not send an email either. Can anyone advise on the best way to do this?

 

Like 0

Like

2 comments

Unfortunately, there is no opportunity to send an email to the organizational role via a business process element "Send email".

However the functionality can be implemented. An idea is to use a script task element in order to select all contact emails which are included in the role. They are selected from the database via EntitySchemaQuery. Then join all selected emails into a string using ";" as separator. After that use the newly built string of emails as an email for sending.

The basic business process "Send email to case group" works in the same way. Please feel free to use the business process as an example. I recommend you to copy the process, change conditions for launching according to your purpose and change an email template. Pay attention to the script task element "Prepare Recipient Emails".

 

Show all comments

I'm trying to have an email process element say the case number in the body. My challenge is I want the PortalMessage object to trigger start the process. If I read all columns of the Portal Message record, Case number is not one of them. 

Is there a way to add a column for case number to the Portal Message object? How do you connect it?

Like 0

Like

2 comments

Dear Mitch, 

The column connecting Portal Message to case already exists. The column is called Object Instance. You can read a case out of the portal message like that (http://prntscr.com/ocum1y)

Best regards,

Dennis 

Dennis Hudson,

That worked perfect. Thanks!

Show all comments

Hi Community,

Any Idea, how can I retrieve not only the unique identifier of the deleted record but also the parent foreign key of the deleted record on delete signal?

My scenario is:

On deletion of a child record, I want to create a business process that will be triggered on delete signal. Then do the re computation of the total amount on parent record after the deletion of the child record. But the problem is on delete signal I can only retrieve unique identifier of the deleted record, I need also to retrieve the parent foreign key of the deleted record for me to re compute and update to total amount of the parent record.

Thanks,

Like 1

Like

6 comments

Dear Fulgen,

If a process that starts on record deletion is started not in the background you can simply add "read data" element that will read all data needed from a record that is deleted. 

Best regards,

Angela

Angela Reyes,

Hi Angela,

Thanks for the reply.

Can you show me example how can i design this logic on business process.

Fulgen Ninofranco,

Just uncheck "Run following elements in the background"

checkbox (http://prntscr.com/o2rt5q) and read all data from the record with this Id. 

Thank you Angela, this solves my problem

Hello colleagues,

 

In 7.18.3.1241 it didn't works, please see on https://prnt.sc/1tzz9qp, I have configured, but cannot recover data from deleted record to update detail totals

Hello Julio,

 

Please provide more details on this object from which records are deleted and how exactly you've deleted them? The simple process that triggers upon deleting one contact works perfectly in 7.18.3 full bundle on my end.

 

Best regards,

Oscar

Show all comments

Hi,

 

Is there a way of sending an SMS from a business process?

 

Thanks in advance...

Like 0

Like

2 comments

Hello,

You will be able to send an SMS if you install the specialized application from the marketplace, for example, "SMS Sender for bpm'online" application (https://marketplace.bpmonline.com/app/sms-sender-bpmonline). For now, it is one way to send an SMS from a business process.

Best regards,

Anastasia

Thank you, Anastasia!

Show all comments

Hi,

I want to run a process for all the records of a section where the business process reads two values of the respective record, modifies a field in that particular record and then does the same for every record in the section.

But I am not sure how to run the process for every single record. I am using Read data element and Reading the first record in the selection which gives the results for the last record that was created in the system but it does not run for every record in the section.

Could someone help?

Like 1

Like

5 comments

I think u can use 'flag' . U can create a new field in the table (not displayed on UI) , mark it 'N' as default for all the records and run the process in loop and update every time it is  N and set the particular record 'Y'  after processing . U can also set how many times the loop should run, default value is 100 u can update it a value according to the data size you are trying to work upon!!  I hope that helps . 

Shailey,

 I already have a lookup and I want to run the process based on the value of that lookup. Will that work or is it essential to have that flag? Can that lookup not act as the flag?

aaykay,

You can use record tag also. First put tag for all records which have specific value for the lookup as "to be processed", then on by one read all records with this tag, after processing, change the tag to some other tag say "processed"

Hi,

I am following as you suggested but the process only runs for the first record.

Shailey writes:

I think u can use 'flag' . U can create a new field in the table (not displayed on UI) , mark it 'N' as default for all the records and run the process in loop and update every time it is N and set the particular record 'Y' after processing

Show all comments

I would like to know how to listen to merge event with business process.

For instance, delete, create and modify events are there:

420.png

I would like to get Id of an entry that was merged, and then use it in business process. 

"Modify" is not always applicable. Sometimes an entry is not considered modified when merged.

Thanks in advance

Like 0

Like

1 comments

Hello Yuriy, 

There is no such out of the box functionality that allows you to subscribe on merge event due to unexisting of such event.

As workaround, you may try to modificate Deduplication process (starts when records are merging). The records that remains in the database is called golden record and id of golden record is the first id in collection that is transferred to deduplication process. 

So once you have this golden record, you may process is it as you wish.

Also please note that process of merging records is asynchronous. 



Regards,

Alex

Show all comments

Processes that are designed to be used as sub-processes can become confusing because Parameters appear in alphabetical order and have no indication of which are required as inputs.  It would be helpful to have an additional checkbox setting for Required or Input in the parameter set up, especially when a process is designed to be used as a sub-process by different teams creating processes.

2 comments

Dear Janine,

You can use an auto-generated page at the begining of the business process with full list of all parameters and you can specify if the field is required to fill in in this auto-generated page (see screenshot http://prntscr.com/n5tita). And you can also change the position of those parameters in an auto-generated page using "Move up" and "Move down" options. And after that you can use those parameters in next steps of a business process.

Best regards,

Oscar

There are two problems with this suggestion.

1) This doesn't help for processes that are designed as subprocesses.  There is no indicator for others teams creating processes based on the processes I'm creating what parameters are input and output parameters without external documentation.

2) Mobile is not very manual start process friendly.

I would rather have a checkbox to enable a star on the parameter when the process is used as a subprocess than have to change the names of parameters to read differently.

Show all comments