Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#787697
hiii,
I am generating two cases but it show the following error
Error:Non-static method G::SendMessageText() should not be called statically, assuming $this from incompatible context


the code is as follows
Code: Select all
$taskId  = '4433593755718b9e8d7da35023655509';
$grid = @=local_tour_Details_grid;
$rows = count($grid);
for ($i=1; $i <= $rows; $i++) {
			$vehicle_master_id_local=$grid[$i]["vehicle_master_id_local"];
			$travellingDateGrid=$grid[$i]["travellingDateGrid"];
			$startTimegrid=$grid[$i]["startTimegrid"];
			$endTimegrid=$grid[$i]["endTimegrid"];
			$local_source_grid=$grid[$i]["local_source_grid"];
			$local_Destination_Grid=$grid[$i]["local_Destination_Grid"];
			$PickupandDropRemark=$grid[$i]["PickupandDropRemark"];
			$isVehilceAllocatedonDate=$grid[$i]["isVehilceAllocatedonDate"];
			$alloted_vehicle_No=$grid[$i]["alloted_vehicle_No"];
			$alloted_Vehicle_type=$grid[$i]["alloted_Vehicle_type"];
			$alloted_vehicle_seating_capacity=$grid[$i]["alloted_vehicle_seating_capacity"];
			$alloted_vehicle_driver_name=$grid[$i]["alloted_vehicle_driver_name"];
			$alloted_vehicle_driver_number=$grid[$i]["alloted_vehicle_driver_number"];
			$alloted_vehicle_remark=$grid[$i]["alloted_vehicle_remark"];
			
	if( $isVehilceAllocatedonDate == "Yes") {
		
	$newCaseId = PMFNewCase( '5427246095718b9e6347c27033022779', @@USER_LOGGED, $taskId,  			   array("vehicle_master_id_local" => "$vehicle_master_id_local",
	  	"travellingDateGrid" => "$travellingDateGrid",
		"startTimegrid" => "$startTimegrid",
		"endTimegrid" => "$endTimegrid", 
		"local_source_grid" => "$local_source_grid", 
		"local_Destination_Grid" => "$local_Destination_Grid", 
		"PickupandDropRemark" => "$PickupandDropRemark", 
		"isVehilceAllocatedonDate" => "$isVehilceAllocatedonDate", 
		"alloted_vehicle_No" => "$alloted_vehicle_No", 
		"alloted_Vehicle_type" => "$alloted_Vehicle_type", 
		"alloted_vehicle_seating_capacity" => "$alloted_vehicle_seating_capacity",
		"alloted_vehicle_driver_name" => "$alloted_vehicle_driver_name",
		"alloted_vehicle_driver_number" => "$alloted_vehicle_driver_number",
		"alloted_vehicle_remark" => "$alloted_vehicle_remark") );
	
	if ($newCaseId) {
		
	   executeQuery("UPDATE APPLICATION SET APP_STATUS='TO_DO' WHERE APP_UID='$newCaseId'");
	}
	else {
	   $msg = "Unable to create new case." . isset(@@__ERROR__) ? @@__ERROR__ : '';
	   G::SendMessageText($msg, 'ERROR');
	}
  }		
}



$taskId1  = '1806640625718b9ec5875a4006492916';
$grid1 = @=local_tour_Details_grid;
$rows1 = count($grid1);
for ($j=1; $j <= $rows1; $j++) {
			$vehicle_master_id_local=$grid[$j]["vehicle_master_id_local"];
			
			$travellingDateGrid=$grid[$j]["travellingDateGrid"];
			$startTimegrid=$grid[$j]["startTimegrid"];
			$endTimegrid=$grid[$j]["endTimegrid"];
			$local_source_grid=$grid[$j]["local_source_grid"];
			$local_Destination_Grid=$grid[$j]["local_Destination_Grid"];
			$PickupandDropRemark=$grid[$j]["PickupandDropRemark"];
			$isVehilceAllocatedonDate=$grid[$j]["isVehilceAllocatedonDate"];
			$alloted_vehicle_No=$grid[$j]["alloted_vehicle_No"];
			$alloted_Vehicle_type=$grid[$j]["alloted_Vehicle_type"];
			$alloted_vehicle_seating_capacity=$grid[$j]["alloted_vehicle_seating_capacity"];
			$alloted_vehicle_driver_name=$grid[$j]["alloted_vehicle_driver_name"];
			$alloted_vehicle_driver_number=$grid[$j]["alloted_vehicle_driver_number"];
			$alloted_vehicle_remark=$grid[$j]["alloted_vehicle_remark"];
			
	if( $isVehilceAllocatedonDate == "Yes") {
		
	$newCaseId1 = PMFNewCase( '5427246095718b9e6347c27033022779', @@USER_LOGGED, $taskId1,  array("vehicle_master_id_local" => "$vehicle_master_id_local",
		"travellingDateGrid" => "$travellingDateGrid",
		"startTimegrid" => "$startTimegrid", 
		"endTimegrid" => "$endTimegrid", 
		"local_source_grid" => "$local_source_grid",
		"local_Destination_Grid" => "$local_Destination_Grid",
		"PickupandDropRemark" => "$PickupandDropRemark",
		"isVehilceAllocatedonDate" => "$isVehilceAllocatedonDate",
		"alloted_vehicle_No" => "$alloted_vehicle_No", 
		"alloted_Vehicle_type" => "$alloted_Vehicle_type", 
		"alloted_vehicle_seating_capacity" => "$alloted_vehicle_seating_capacity", 							"alloted_vehicle_driver_name" => "$alloted_vehicle_driver_name", 
		"alloted_vehicle_driver_number" => "$alloted_vehicle_driver_number",
		"alloted_vehicle_remark" => "$alloted_vehicle_remark") );
	
	if ($newCaseId1) {
	   executeQuery("UPDATE APPLICATION SET APP_STATUS='TO_DO' WHERE APP_UID='$newCaseId1'");
	}
	else {
	   $msg = "Unable to create new case." . isset(@@__ERROR__) ? @@__ERROR__ : '';
	   G::SendMessageText($msg, 'ERROR');
	}
  }		
}
#787724
Dear amosbatto ,

I generating two cases but it didn't generate 2 cases it show error that i mentioned in previous post.
Error:Non-static method G::SendMessageText() should not be called statically, assuming $this from incompatible context
#787749
OK, first use the code I gave you so you won't see the G::SendTextMessage() warning message and might see another error message from PMFNewCase(). Then, check whether your @@USER_LOGGED is assigned to the initial task in the process where you are trying to create a new case. If not, then you either have to assign that user to the initial task or use PMFNewCaseImpersonate().
Also check whether your $taskId is an initial task in the process where you are creating a case. It needs to have a start event before it.
Then double check your IDs to make sure they are correct.

Do you want a quick way to delete passwords from P[…]

Try the CloudMigration PST Converter to convert […]

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]