How do I copy sharepoint list entries to another list when certain conditions are fulfilled (Status = publish & Audience = all)

We want to publish a FAQ list on a sharepoint site. We have another list that people work on, in which the question is logged, a person that should answer it is tagged and so on. I would like to copy the list entries to another list when the “Choice column for the audience” is set to “all” (which is done when the question is first logged) and the “Sign off person” sets the “Choice column for the status” to “publish”. How can I do this?

I checked out Power Automate/Flow but I can’t find anything that lets me put the conditions as described above.

Thank you very much for your help!
Franziska

c# – Record status of http call to show in the UI

What I am wanting to do, is record the status of a HTTP call, so that I can give the user some feedback in the UI, rather than either succeeding silently, or showing a grim error.

What I have done is created a Result class. For ease, I will show the simple class, but I also have this as a generic class, so it can also contain data.

The Result class:

public class Result
    {
        public bool IsSuccess { get; set; }

        public string Error { get; set; }

        public HttpStatusCode HttpStatusCode { get; set; }

        public Result() { }

        public Result(bool isSuccess)
        {
            IsSuccess = isSuccess;
        }

        public Result(string errors, bool isSuccess)
        {
            IsSuccess = isSuccess;
            Error = errors;
        }

        public Result(string errors, bool isSuccess, HttpStatusCode statusCode)
        {
            Error = errors;
            IsSuccess = isSuccess;
            HttpStatusCode = statusCode;
        }
    }

When I make a call to the API I am using, I use the Result class, as below:

public async Task<Result> UpdateColour(GrapeColour grapeColour)
        {
            var body = new StringContent(JsonConvert.SerializeObject(grapeColour), Encoding.UTF8, "application/json");
            var client = _httpClient.CreateClient(ApiNames.WineApi);

            var response = await client.PutAsync(_grapeColourUrl, body).ConfigureAwait(false);
            if (response.IsSuccessStatusCode)
            {
                return new Result(true);
            }
            else
            {
                return await HttpResponseHandler.HandleError(response).ConfigureAwait(false);
            }
        }

Where my HttpResponseHandler does some stuff, but fundamentally writes the bool isSuccessful to false, give an error message, and set the status code.

This all lives in my Domain layer.

I then pass this over to the web side of my project, here is the controller method:

(HttpPost)
        public async Task<IActionResult> EditColour(Result<EditableGrapeColourViewModel> model)
        {
            if (!ModelState.IsValid)
            {
                return View(new Result<EditableGrapeColourViewModel>(model.Data));
            }

            var domainGrapeColour = _grapeMapper.Map<Domain.Grape.GrapeColour>(model.Data);

            var saveResult = await _grapeService.SaveColour(domainGrapeColour, SaveType.Update).ConfigureAwait(false);
            if (saveResult.IsSuccess)
            {
                return RedirectToAction("EditColour", "Grape", new { id = model.Data.Id, IsSuccess = true });
            }

            var viewModel = new Result<EditableGrapeColourViewModel>(saveResult.IsSuccess, saveResult.Error, model.Data);

            return View(viewModel);
        }

So the model I use in for the viewmodel and the view has to be the Result<T> so I can access the isSuccessful and the error message to show the user.

I use automapper to map from my domain object, to an object in the web project, but I use the domain Result.

So my question is two fold; Is what I am doing a decent solution for what I want to do? And if it is, should I be using the domain Result object as I am?

8 – JSON:API error unprocessable entity status 422 entity_id this value should not be null

I’m trying to post a flag with JSON:API but I’m getting the following error:

"errors": [
    {
        "title": "Unprocessable Entity",
        "status": "422",
        "detail": "entity_id: This value should not be null.",
        "source": {
            "pointer": "/data/attributes/entity_id"
        }
    }

I’m very confused because in the data I’m posting, the entity_id is definitely included…

Battery Status not showing in ubuntu 20.04

My laptop was on and suddenly battery status icon from the top right corner became invisible and a power icon started appearing but that was not there previously.
I have installed a battery indicator but this is also not working. Please help
I am providing a snapshot so that things become more understandable.
enter image description here

Along with this, my laptop’s power indicator also started blinking with red color. Please help me to resolve this issue.
Below is its picture.
enter image description here

magento2.3 – Display stock status on product detail page

for total quantity

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$StockState = $objectManager->get('MagentoCatalogInventoryApiStockStateInterface');
echo $StockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId());

and if you want to get status

$stockItem = $objectManager->get('MagentoCatalogInventoryModelStockStockItemRepository');
$productId =1; // YOUR PRODUCT ID
$productStock = $stockItem->get($productId);
$data_p = $productStock->getData();
echo $data_p('is_in_stock'); //1 in stock 0 for out of stock


client – A wrong deal: the status is “0 / unacknowledged, not in memory pool “

I started a transaction with bitcoin-0.21.0-win64, a Windows client. It may be that the fee is set too low, which leads to the unsuccessful transaction. What should I do in the future? What do I need to do? How to implement the specific operation steps? Below is the transaction details, please help! Thank you very much!

Status: 0 / unacknowledged, not in memory pool
Date: 2021 / 3 / 8 12:31
To: coin an 1kgsxf7krv1ab99tex1wjm643tsilczbg6
Expenditure: – 0.05193365 BTC
Transaction fee: – 0.00120000 BTC
Net amount: – 0.05313365 BTC
Transaction ID: aceea84e8a72b24654cba7b1d042561d8a9d36f7828855b52012de8a5a0b9c12
Total transaction size: 11767 bytes
Transaction Virtual Size: 11767 bytes
Output index: 0

java – Post request de postman returns html status: 200

Tengo una aplicasion de spring boot que guarda a un usuario en una base de datos
la clase RegistrationController recive una request @Postmapping y la mapea a otra clase llamada RegistrationRequest

@RestController
@RequestMapping(path = "api/v1/registration")
@AllArgsConstructor
public class RegistrationController {
    
     private   final RegistrationService registrationService;
     
    @PostMapping
    
    public String register (@RequestBody RegistrationRequest request) {     
    
        return registrationService.register(request);
    }

}

Despues tengo otra clase RegistrationService que la genera un nuevo usuario para la aplicacion y lo guarda en la base de datos esta clase ulitliza

@Service
@AllArgsConstructor
public class RegistrationService {
    
    private final  AppUserService appUserService;
    private  final EmailValidator emailValidator;
    

    public  String register(RegistrationRequest request) {
         boolean isValidEmail = emailValidator.test(request.getEmail());
         
         
         if (!isValidEmail) {
             throw new  IllegalStateException("Email is not valid");
         }
         
        return appUserService.singUpUser(new AppUser(
                request.getFristName(),
                request.getLastName(),
                request.getEmail(), 
                request.getPassword(), 
                AppUserRole.USER)
                );
        
         
    }

}

La clase appUser es el modelo que va a guardar en la base de datos Usa un servicio para entra en spring sequrity asi

@Service
@AllArgsConstructor
public class AppUserService  implements UserDetailsService{
    
    private final static String USER_NOT_FOUND_MSG = "user with email %s not found";
    private final AppUserRepository appUserRepository;
    
    private final BCryptPasswordEncoder bCryptPasswordEncoder;
    
    @Override
    public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
        // TODO Auto-generated method stub
        return appUserRepository.findByEmail(email).
                orElseThrow( ()-> new UsernameNotFoundException(String.format(USER_NOT_FOUND_MSG, email)));
    }

    
public String singUpUser (AppUser appUser) {
    
        boolean userExist = appUserRepository.findByEmail(appUser.getEmail()).isPresent();
        
        if(userExist) {
            
            throw new IllegalStateException("email already exist");
            
        }
        
        
        
         String  encodedPassword = bCryptPasswordEncoder.encode(appUser.getPassword());
         
         appUser.setPassword(encodedPassword);
         
         
         appUserRepository.save(appUser);
         
         //TO DO  send confirmation token
         
         return "it works";
         
    }
    
    
    }

Quiero que la repuesta de mi postman sea “it works” pero en ves me regresa un HTML con status:200 ok

magento2 – how to create controller to show product name and stock status (Available/out of stock) in magento?

I want to create a table to show stock status if all products.
This table will contains following fields:
=> Product Name
=> Product SKU
=> Quantity
=> Stock Status (In Stock / Out of Stock)

I tried using object manager.. but not able to find mistake in Stock Status.

Here is my code:

<?php

$objectManager = MagentoFrameworkAppObjectManager::getInstance();

$productCollection = $objectManager
    ->create('MagentoCatalogModelResourceModelProductCollectionFactory');

    

$collection = $productCollection->create()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('type_id', array('neq' => 'configurable'))
    ->joinField('stock_item', 'cataloginventory_stock_item', 'qty', 'product_id=entity_id') // add 'qty=0' to get outofstock products
    ->load();
 
?>

<table>
    <thead>
        <tr>
            <td>Sr.</td>
            <td>Name</td>
            <td>SKU</td>
            <td>Quantity</td>
            <td>Stock Status</td>
        </tr>
    </thead>
    <tbody>
        <?php
        $count = 1;
        foreach ($collection as $product) {
        ?>
            <tr>
                <td><?php echo $count; ?></td>
                <td><?php echo $product->getName(); ?></td>
                <td><?php echo $product->getSku(); ?></td>
                <td><?php if($product->getStockItem()==NULL){echo "-";} else { echo $product->getStockItem(); } ?></td>
                <td>
                <?php
                 
                if($product->getStockItem() > 0)
                { 
                    echo '<span style="color:green;">In Stock</span>';
                } 
                elseif($product->getStockItem() == NULL)
                {
                    echo '<span style="color:blue;">N/A</span>';

                } 
                else 
                {
                    echo '<span style="color:red;">Out of Stock</span>';
                } ?>
                </td>
            </tr>
        <?php $count++;
        } ?>
    </tbody>
</table>

us citizens – Must you tell the truth about your marital status on a passport application?

Lying on a passport application is a serious crime punishable by a fine of up to $250,000 or up to 10 years in prison. https://www.law.cornell.edu/uscode/text/18/1542

will there be any trouble?

No one knows. Maybe she gets away with it, maybe she gets caught. Even if it works today, she still can be found out later. Maybe in ten years when she renews. Maybe in 20 years Pakistan, India and the US have a shared marriage date base, who knows?

Given that it’s a serious crime with potential heavy penalty it is really NOT something she should do. Whatever the reason for hiding her status, she should consider alternatives in dealing with it. Talking to a lawyer might help: maybe her marriage can be annulled or can be considered “invalid” for US purposes.